<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/11/2
 * Time: 13:43
 */
session_start();
$mes = file_get_contents('../url.txt');
$mes = explode("\r\n",$mes);

if ($_POST){
    $web_url = @$_POST['web_url'];
    $mobile_url = @$_POST['mobile_url'];
    file_put_contents('url.txt',$web_url."\r\n".$mobile_url);
    header("Location: admin.php");
    exit();
}
?>
<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

    <title>修改地址</title>
</head>
<body background="../img/bj1.jpg">
<div style="margin: 10% 30%;color: wheat">
    <a href="signout.php" class="btn btn-danger" style="float: right;">登出</a>
    <h2>修改地址</h2>
    <form method="post" action="">
        <label>实盘网址：</label>
        <input type="text" name="web_url" value="<?php echo $mes[0] ?>" style="width: 500px" class="form-control" id="exampleInputPassword3"><br>
        <label> 微信提示跳转地址：</label>
        <input type="text" name="mobile_url" value="<?php echo $mes[1] ?>" style="width: 500px;" class="form-control" id="exampleInputPassword3"><br>
        <button type="submit" class="btn btn-danger">确认修改</button><br><br>
        <label>实盘直达地址：</label><h2>http://<?=$_SERVER['HTTP_HOST']?>/web.php</h2> <br>
        <label> 微信提示跳转地址：</label><h2>http://<?=$_SERVER['HTTP_HOST']?>/mobile.php</h2>
    </form>
    <br>

</div>
<div style="color: floralwhite;" align="center">
</div>
</body>
</html>
